using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Purchase;
using HengTong.Model.Db.SupplyChain.Material;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel.SupplyChain.SysPurchaseRequirementPoolEntryVms
{
    public partial class SysPurchaseRequirementPoolEntryTemplateVm : BaseTemplateVM
    {
        [Display(Name = "需求池")]
        public ExcelPropety PoolExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.PoolId);
        [Display(Name = "采购申请单")]
        public ExcelPropety RequestBillExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.RequestBillId);
        [Display(Name = "申请单明细")]
        public ExcelPropety RequestBillEntryExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.RequestBillEntryId);
        [Display(Name = "物料")]
        public ExcelPropety MaterialExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.MaterialId);
        public ExcelPropety MaterialSkuExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.MaterialSkuId);
        [Display(Name = "申请数量")]
        public ExcelPropety RequestQuantityExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.RequestQuantity);
        [Display(Name = "预计单价")]
        public ExcelPropety EstimatedPriceExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.EstimatedPrice);
        [Display(Name = "预算金额")]
        public ExcelPropety BudgetAmountExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.BudgetAmount);
        [Display(Name = "已采购数量")]
        public ExcelPropety PurchasedQuantityExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.PurchasedQuantity);
        [Display(Name = "剩余数量")]
        public ExcelPropety RemainingQuantityExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.RemainingQuantity);
        [Display(Name = "申请部门")]
        public ExcelPropety GroupExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.GroupId);
        [Display(Name = "申请人")]
        public ExcelPropety RequestByExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.RequestBy);
        [Display(Name = "采购类型")]
        public ExcelPropety PurchaseTypeExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.PurchaseType);
        [Display(Name = "物料类型")]
        public ExcelPropety MaterialTypeExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.MaterialType);
        [Display(Name = "紧急程度")]
        public ExcelPropety UrgencyLevelExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.UrgencyLevel);
        [Display(Name = "要求到货日期")]
        public ExcelPropety RequiredDeliveryDateExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.RequiredDeliveryDate);
        [Display(Name = "审批通过日期")]
        public ExcelPropety ApprovalDateExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.ApprovalDate);
        [Display(Name = "入池日期")]
        public ExcelPropety EntryDateExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.EntryDate);
        [Display(Name = "采购状态")]
        public ExcelPropety PurchaseStateExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.PurchaseState);
        [Display(Name = "采购策略")]
        public ExcelPropety PurchaseStrategyExcel = ExcelPropety.CreateProperty<SysPurchaseRequirementPoolEntry>(x => x.PurchaseStrategy);

	    protected override void InitVM()
        {
            PoolExcel.DataType = ColumnDataType.ComboBox;
            PoolExcel.ListItems = DC.Set<SysPurchaseRequirementPool>().GetSelectListItems(Wtm, y => y.Name);
            RequestBillExcel.DataType = ColumnDataType.ComboBox;
            RequestBillExcel.ListItems = DC.Set<SysPurchaseRequestBill>().GetSelectListItems(Wtm, y => y.BillCode);
            RequestBillEntryExcel.DataType = ColumnDataType.ComboBox;
            RequestBillEntryExcel.ListItems = DC.Set<SysPurchaseRequestBillEntry>().GetSelectListItems(Wtm, y => y.CreateBy);
            MaterialExcel.DataType = ColumnDataType.ComboBox;
            MaterialExcel.ListItems = DC.Set<SysMaterial>().GetSelectListItems(Wtm, y => y.Code);
            MaterialSkuExcel.DataType = ColumnDataType.ComboBox;
            MaterialSkuExcel.ListItems = DC.Set<SysMaterialSku>().GetSelectListItems(Wtm, y => y.Code);
            GroupExcel.DataType = ColumnDataType.ComboBox;
            GroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.FullName);
        }

    }

    public class SysPurchaseRequirementPoolEntryImportVm : BaseImportVM<SysPurchaseRequirementPoolEntryTemplateVm, SysPurchaseRequirementPoolEntry>
    {

    }

}
